package simbot.example.entity;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * Bangumi Json数据实体类
 *
 * @author minmin
 * @since 2021/07/03 1:15
 */
@Data
public class BangumiEntity implements Serializable {

    /**
     * weekday : {"en":"Mon","cn":"星期一","ja":"月耀日","id":1}
     * items : [{"id":227897,"url":"http://bgm.tv/subject/227897","type":2,"name":"黑白无双 第三季","name_cn":"","summary":"","air_date":"2021-07-19","air_weekday":1,"images":{"large":"http://lain.bgm.tv/pic/cover/l/86/50/227897_LP1X1.jpg","common":"http://lain.bgm.tv/pic/cover/c/86/50/227897_LP1X1.jpg","medium":"http://lain.bgm.tv/pic/cover/m/86/50/227897_LP1X1.jpg","small":"http://lain.bgm.tv/pic/cover/s/86/50/227897_LP1X1.jpg","grid":"http://lain.bgm.tv/pic/cover/g/86/50/227897_LP1X1.jpg"},"collection":{"doing":1}},{"id":292832,"url":"http://bgm.tv/subject/292832","type":2,"name":"うらみちお兄さん","name_cn":"阴晴不定大哥哥","summary":"","air_date":"2021-07-05","air_weekday":1,"rating":{"total":72,"count":{"1":3,"2":1,"3":2,"4":7,"5":14,"6":22,"7":17,"8":5,"9":1,"10":0},"score":5.7},"rank":4896,"images":{"large":"http://lain.bgm.tv/pic/cover/l/7c/6b/292832_OZ2zs.jpg","common":"http://lain.bgm.tv/pic/cover/c/7c/6b/292832_OZ2zs.jpg","medium":"http://lain.bgm.tv/pic/cover/m/7c/6b/292832_OZ2zs.jpg","small":"http://lain.bgm.tv/pic/cover/s/7c/6b/292832_OZ2zs.jpg","grid":"http://lain.bgm.tv/pic/cover/g/7c/6b/292832_OZ2zs.jpg"},"collection":{"doing":319}},{"id":319286,"url":"http://bgm.tv/subject/319286","type":2,"name":"出会って5秒でバトル","name_cn":"见面之后5秒开始战斗","summary":"","air_date":"2021-07-12","air_weekday":1,"rating":{"total":10,"count":{"1":0,"2":0,"3":0,"4":0,"5":1,"6":2,"7":5,"8":2,"9":0,"10":0},"score":6.8},"images":{"large":"http://lain.bgm.tv/pic/cover/l/4b/34/319286_Vf1Lf.jpg","common":"http://lain.bgm.tv/pic/cover/c/4b/34/319286_Vf1Lf.jpg","medium":"http://lain.bgm.tv/pic/cover/m/4b/34/319286_Vf1Lf.jpg","small":"http://lain.bgm.tv/pic/cover/s/4b/34/319286_Vf1Lf.jpg","grid":"http://lain.bgm.tv/pic/cover/g/4b/34/319286_Vf1Lf.jpg"},"collection":{"doing":266}},{"id":320851,"url":"http://bgm.tv/subject/320851","type":2,"name":"精霊幻想記","name_cn":"精灵幻想记","summary":"","air_date":"2021-07-05","air_weekday":1,"rating":{"total":82,"count":{"1":3,"2":0,"3":0,"4":12,"5":15,"6":24,"7":20,"8":7,"9":0,"10":1},"score":5.8},"rank":4834,"images":{"large":"http://lain.bgm.tv/pic/cover/l/ad/ee/320851_MPMXr.jpg","common":"http://lain.bgm.tv/pic/cover/c/ad/ee/320851_MPMXr.jpg","medium":"http://lain.bgm.tv/pic/cover/m/ad/ee/320851_MPMXr.jpg","small":"http://lain.bgm.tv/pic/cover/s/ad/ee/320851_MPMXr.jpg","grid":"http://lain.bgm.tv/pic/cover/g/ad/ee/320851_MPMXr.jpg"},"collection":{"doing":379}},{"id":340164,"url":"http://bgm.tv/subject/340164","type":2,"name":"しゃばけ","name_cn":"娑婆气","summary":"","air_date":"2021-07-19","air_weekday":1,"images":null,"collection":{"doing":1}},{"id":340272,"url":"http://bgm.tv/subject/340272","type":2,"name":"源神浩劫","name_cn":"","summary":"","air_date":"2021-07-05","air_weekday":1,"images":{"large":"http://lain.bgm.tv/pic/cover/l/4b/ef/340272_jb24W.jpg","common":"http://lain.bgm.tv/pic/cover/c/4b/ef/340272_jb24W.jpg","medium":"http://lain.bgm.tv/pic/cover/m/4b/ef/340272_jb24W.jpg","small":"http://lain.bgm.tv/pic/cover/s/4b/ef/340272_jb24W.jpg","grid":"http://lain.bgm.tv/pic/cover/g/4b/ef/340272_jb24W.jpg"},"collection":{"doing":2}}]
     */

    @JSONField(name = "weekday")
    private Weekday weekday;
    @JSONField(name = "items")
    private List<Items> items;

    @Data
    public static class Weekday implements Serializable {
        /**
         * en : Mon
         * cn : 星期一
         * ja : 月耀日
         * id : 1
         */

        @JSONField(name = "en")
        private String en;
        @JSONField(name = "cn")
        private String cn;
        @JSONField(name = "ja")
        private String ja;
        @JSONField(name = "id")
        private Integer id;
    }

    @Data
    public static class Items implements Serializable {
        /**
         * id : 227897
         * url : http://bgm.tv/subject/227897
         * type : 2
         * name : 黑白无双 第三季
         * name_cn :
         * summary :
         * air_date : 2021-07-19
         * air_weekday : 1
         * images : {"large":"http://lain.bgm.tv/pic/cover/l/86/50/227897_LP1X1.jpg","common":"http://lain.bgm.tv/pic/cover/c/86/50/227897_LP1X1.jpg","medium":"http://lain.bgm.tv/pic/cover/m/86/50/227897_LP1X1.jpg","small":"http://lain.bgm.tv/pic/cover/s/86/50/227897_LP1X1.jpg","grid":"http://lain.bgm.tv/pic/cover/g/86/50/227897_LP1X1.jpg"}
         * collection : {"doing":1}
         * rating : {"total":72,"count":{"1":3,"2":1,"3":2,"4":7,"5":14,"6":22,"7":17,"8":5,"9":1,"10":0},"score":5.7}
         * rank : 4896
         */

        @JSONField(name = "id")
        private Integer id;
        @JSONField(name = "url")
        private String url;
        @JSONField(name = "type")
        private Integer type;
        @JSONField(name = "name")
        private String name;
        @JSONField(name = "name_cn")
        private String nameCn;
        @JSONField(name = "summary")
        private String summary;
        @JSONField(name = "air_date")
        private String airDate;
        @JSONField(name = "air_weekday")
        private Integer airWeekday;
        @JSONField(name = "images")
        private Images images;
        @JSONField(name = "collection")
        private Collection collection;
        @JSONField(name = "rating")
        private Rating rating;
        @JSONField(name = "rank")
        private Integer rank;

        @Data
        public static class Images implements Serializable {
            /**
             * large : http://lain.bgm.tv/pic/cover/l/86/50/227897_LP1X1.jpg
             * common : http://lain.bgm.tv/pic/cover/c/86/50/227897_LP1X1.jpg
             * medium : http://lain.bgm.tv/pic/cover/m/86/50/227897_LP1X1.jpg
             * small : http://lain.bgm.tv/pic/cover/s/86/50/227897_LP1X1.jpg
             * grid : http://lain.bgm.tv/pic/cover/g/86/50/227897_LP1X1.jpg
             */

            @JSONField(name = "large")
            private String large;
            @JSONField(name = "common")
            private String common;
            @JSONField(name = "medium")
            private String medium;
            @JSONField(name = "small")
            private String small;
            @JSONField(name = "grid")
            private String grid;
        }

        @Data
        public static class Collection implements Serializable {
            /**
             * doing : 1
             */

            @JSONField(name = "doing")
            private Integer doing;
        }

        @Data
        public static class Rating implements Serializable {
            /**
             * total : 72
             * count : {"1":3,"2":1,"3":2,"4":7,"5":14,"6":22,"7":17,"8":5,"9":1,"10":0}
             * score : 5.7
             */

            @JSONField(name = "total")
            private Integer total;
            @JSONField(name = "count")
            private Count count;
            @JSONField(name = "score")
            private Double score;

            @Data
            public static class Count implements Serializable {
                /**
                 * 1 : 3
                 * 2 : 1
                 * 3 : 2
                 * 4 : 7
                 * 5 : 14
                 * 6 : 22
                 * 7 : 17
                 * 8 : 5
                 * 9 : 1
                 * 10 : 0
                 */

                @JSONField(name = "1")
                private Integer $1;
                @JSONField(name = "2")
                private Integer $2;
                @JSONField(name = "3")
                private Integer $3;
                @JSONField(name = "4")
                private Integer $4;
                @JSONField(name = "5")
                private Integer $5;
                @JSONField(name = "6")
                private Integer $6;
                @JSONField(name = "7")
                private Integer $7;
                @JSONField(name = "8")
                private Integer $8;
                @JSONField(name = "9")
                private Integer $9;
                @JSONField(name = "10")
                private Integer $10;
            }
        }
    }
}
